package com.apes.auto.maintain.service;

import com.apes.auto.maintain.model.LevelMaintain;
import com.apes.auto.maintain.repository.LevelMaintainRepository;
import com.apes.framework.api.DomainService;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName LevelMaintainService
 * @Description TODO
 * @Author pengyb
 * @Date 2019/8/8 18:16
 * @Version 1.0
 **/
@Service("levelMaintainService")
public class LevelMaintainService extends DomainService {
    @Autowired
    private LevelMaintainRepository levelMaintenRepository;

    public LevelMaintain save(SimpleRequest request) {
        LevelMaintain o = request.getO(LevelMaintain.class);
        return levelMaintenRepository.saveAndFlush(o);
    }

    public String delete(SimpleRequest request) {
        LevelMaintain o = request.getO(LevelMaintain.class);
        levelMaintenRepository.delete(o);
        return "删除成功";
    }
}
